package com.example.pages;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;


public class UserPage extends InternalPage {

	@FindBy (id = "email")
	public WebElement emailField;
	
	@FindBy (name = "submit")
	public WebElement saveButton;
	
	public UserPage changeEmailTo(String email) {
		this.emailField.clear();
		this.emailField.sendKeys(email);
		this.saveButton.click();
		return MyPageFactory.getPage(driver, UserPage.class);
	}
	
	public boolean IsOnThisPage() {
		String url = "http://localhost/php4dvd/?go=profile";
		return url.equals(driver.getCurrentUrl());
	}
}
